package redisdemo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import redisdemo.util.RedisLock;

@RestController
public class LockController {
    @Autowired
    private RedisLock redisLock;

    @RequestMapping("lock")
    public Boolean lock(String key,String value)
    {
        return redisLock.lock(key,value);
    }

    @RequestMapping("unlock")
    public Boolean unlock(String key,String value)
    {
        return redisLock.unLock(key,value);
    }
}
